<template>
  <div class="notice-page">
    <div class="box">
      <b-button type="default" @click="open1">默认通知</b-button>
      <b-button type="info" @click="open2">信息通知</b-button>
      <b-button type="success" @click="open3">成功通知</b-button>
      <b-button type="warning" @click="open4">警告通知</b-button>
      <b-button type="error" @click="open5">失败通知</b-button>
    </div>
    <div class="box">
      <b-button type="info" @click="infoClick">信息通知</b-button>
      <b-button type="success" @click="successClick">成功通知</b-button>
      <b-button type="warning" @click="warningClick">警告通知</b-button>
      <b-button type="error" @click="errorClick">失败通知</b-button>
      <b-button type="joker" @click="close">测试关闭回调</b-button>
    </div>
  </div>
</template>
<script>
export default {
  name: "NoticePage",
  methods: {
    close(){
      this.$Notice.noticeClose(()=>{
        console.log('-----');
      })
    },
    open1() {
      this.$Notice.open({
        title: "我是默认信息标题",
        desc:
          "我是默认内容，我是默认内容，我是默认内容，我是默认内容，我是默认内容，我是默认内容，",
      });
    },
    open2() {
      this.$Notice.open({
        icon: true,
        type: "info",
        title: "我是open信息标题",
        desc:
          "我是open信息，我是默认内容我是open信息，我是open信息，我是open信息，我是默认内容我是open信息，我是默认内容我是open信息，",
      });
    },
    open3() {
      this.$Notice.open({
        icon: true,
        type: "success",
        title: "我是成功标题",
        desc: "我是成功，我是成功，我是成功，我是成功息，我是成功，我是成功，",
      });
    },
    open4() {
      this.$Notice.open({
        icon: true,
        type: "warning",
        title: "我是警告标题",
        desc: "我是警告，我是警告，我是警告，我是警告，我是警告，我是警告，",
        duration: 8,
      });
    },
    open5() {
      this.$Notice.open({
        icon: true,
        type: "error",
        title: "我是失败标题",
        desc: "我是失败，我是失败，我是失败，我是失败，我是失败，我是失败，",
        duration: 2,
      });
    },
    infoClick() {
      this.$Notice.info({
        title: "info标题",
        desc: "info啦啦啦啦啦啦啦",
        duration: 5,
      });
    },
    successClick() {
      this.$Notice.success({
        title: "success标题",
        desc: "success成功成功哇哇哇哇哇哇哇",
        duration: 3,
      });
    },
    warningClick() {
      this.$Notice.warning({
        title: "warning标题",
        desc: "warning警告警告靖哥哥",
        duration: 5,
      });
    },
    errorClick() {
      this.$Notice.error({
        title: "error标题",
        desc: "error失败啦失败啦",
        duration: 5,
      });
    },
  },
};
</script>
<style scoped>
.notice-page .box button {
  margin-right: 20px;
  margin-top: 20px;
}
</style>